Skip to main content

Debugging Node-RED

This guide provides comprehensive troubleshooting procedures for Node-RED issues on the OV20i camera system. Use this for field repair, debugging production issues, and preventative maintenance of inspection flows.

warning

Safety First: Always notify production before making changes to active inspection systems. Create backups before modifying flows.

Emergency Quick-Fix Procedures

Critical System Down - Immediate Actions

StepActionTimeResult
1Check camera power LED status30 secVerify hardware OK
2Access OV20i Node-RED: http://camera-ip/recipes/<recipe-number>/ioblock1 minConfirm editor accessible
3Look for red triangle error indicators1 minIdentify failing nodes
4Click Deploy button (Full Deploy)30 secReset all flows
5Test basic inspection trigger2 minVerify system operational

System Recovery (If Editor Won't Load)

OV20i cameras do not have a safe mode - restart is the primary recovery method:

  1. Power cycle the camera (unplug power for 10 seconds)
  2. Wait for full boot (all 4 LEDs stable - 2-3 minutes)
  3. Access active recipe's Node-RED via recipe-specific URL
  4. Verify flow integrity and make necessary fixes
  5. Deploy changes to restore normal operation
note

URL Format: http://<camera-ip>/recipes/<recipe-number>/ioblock

Examples:

  • http://192.168.0.101/recipes/20/ioblock
  • http://192.168.0.105/recipes/1/ioblock

Systematic Debugging Process

Step 1: Identify the Problem Scope

Quick Assessment Questions

QuestionIf YESIf NO
Can you access OV20i Node-RED interface?Continue to Step 2Check network/camera status
Are flows visible in editor?Continue to Step 2Power cycle camera and retry
Do you see error triangles on nodes?Focus on those nodes firstCheck flow execution
Is inspection triggering?Check individual node outputsVerify trigger inputs
note

Access URL: Use recipe-specific URL format: http://<camera-ip>/recipes/<recipe-number>/ioblock

Step 2: Enable Debug Monitoring

Add Debug Nodes for Troubleshooting

  1. Place Debug nodes at key points in problematic flows:
    • After trigger inputs
    • Before and after logic nodes
    • At final outputs
  2. Configure Debug nodes for maximum information:
    • Output: Complete message object
    • To: Debug sidebar
    • Name: Descriptive names (e.g., "After Classification Logic")
  3. Enable all Debug nodes by clicking their buttons in the editor

Debug Sidebar Management

Access Debug Sidebar:

  • Click Debug tab (bug icon) in right panel
  • Clear old messages using trash can icon
  • Filter messages if too many nodes are active

Debug Message Interpretation:

  • Timestamp shows when message occurred
  • Node name shows which node generated message
  • Message content shows data structure and values

Step 3: Trace Flow Execution

Follow Message Path

  1. Start from trigger source (injection, timer, external input)
  2. Verify each node receives expected input
  3. Check message transformations at each step
  4. Identify where flow stops or produces wrong output

Common Flow Interruption Points

Node TypeCommon IssuesQuick Check
Classification LogicNo confidence threshold metCheck ROI alignment, retrain model
Switch NodeWrong condition logicVerify switch rules and message properties
Join NodeWaiting for incomplete message setCheck message parts count
Function NodeJavaScript errorsCheck browser console for errors
HTTP RequestNetwork connectivityTest endpoint manually

Common Node-RED Issues & Solutions

Flow Execution Problems

Issue: Flow Not Triggering

Symptoms:

  • No messages in Debug sidebar
  • System appears inactive
  • External triggers not working

Diagnosis Steps:

  1. Check trigger source: Manual inject, timer, external input
  2. Verify wiring: Ensure connections between nodes
  3. Test manual trigger: Use Inject node to force flow start

Solutions:

CauseSolutionPrevention
Disabled flowsClick Deploy → Full DeployRegular deployment after changes
Broken connectionsRewire nodes properlyVisual inspection during edits
Timer misconfigurationCheck inject node timing settingsDocument timing requirements
External trigger failureVerify I/O wiring and signalsRegular I/O testing

Issue: Flows Running But Wrong Results

Symptoms:

  • Messages flowing but incorrect classifications
  • Pass/fail logic not working correctly
  • Inconsistent results

Diagnosis Process:

  1. Add Debug nodes before and after suspect nodes
  2. Compare expected vs actual message content
  3. Check node configurations for correct parameters

Solutions:

Problem AreaCheckFix
Classification LogicROI alignment, model trainingRetrain or adjust ROI
Switch ConditionsProperty names and valuesCorrect switch logic
Message PropertiesData types and formatsUse Change node to fix format
Context VariablesStored values and scopeClear/reset context storage

Performance Issues

Issue: Slow Flow Execution

Symptoms:

  • Delays between trigger and output
  • Inspection timeouts
  • System lag

Performance Diagnostics:

  1. Check Debug timestamps to identify slow nodes
  2. Monitor CPU usage on camera system
  3. Count active Debug nodes (disable unused ones)

Optimization Actions:

Performance IssueSolutionExpected Improvement
Too many Debug nodesDisable/remove unused Debug nodes10-20% speed increase
Complex Function nodesOptimize JavaScript codeVariable improvement
High-frequency triggersAdd delay/rate limitingPrevent system overload
Large message objectsReduce message payload sizeFaster processing

Maintenance Procedures

Daily Health Checks

Visual Flow Inspection (5 minutes)

  1. Access Node-RED editor
  2. Check for error indicators (red triangles)
  3. Verify flow connections are intact
  4. Review recent Debug messages for anomalies

Flow Execution Test (10 minutes)

  1. Manual trigger test using Inject nodes
  2. Verify expected outputs in Debug sidebar
  3. Test pass/fail logic with known good/bad parts
  4. Confirm external communications (PLC, databases)

Monthly Maintenance Tasks

Performance Review (15 minutes)

Flow Optimization Checklist:

TaskActionNotes
Debug Node CleanupDisable unused Debug nodesKeep only essential debugging
Context Storage ReviewClear unnecessary stored valuesPrevent memory buildup
Error Log ReviewCheck browser console for errorsDocument recurring issues
Backup CreationExport flows to backup fileStore with date/version info

Configuration Validation (20 minutes)

  1. Compare current flows with documented standards
  2. Verify all critical paths have appropriate error handling
  3. Test error recovery scenarios
  4. Update documentation for any changes

Monthly Deep Maintenance

Comprehensive Flow Analysis (45 minutes)

Performance Metrics Collection:

  • Flow execution times
  • Error frequency analysis
  • Resource usage patterns
  • Communication reliability

Flow Structure Review:

  • Eliminate redundant nodes
  • Consolidate duplicate logic
  • Update deprecated configurations
  • Optimize complex Function nodes

Backup and Recovery Testing (30 minutes)

  1. Create complete flow export
  2. Test import procedure on backup system
  3. Verify backup restoration maintains functionality
  4. Document recovery procedures

Diagnostic Tools and Techniques

Built-in Node-RED Tools

Debug Sidebar Features

FeatureUse CaseAccess Method
Message FilteringFocus on specific nodesFilter button in sidebar
Message HistoryReview past 100 messagesScroll in Debug sidebar
Node LocationFind source of Debug messageClick node name in message
Message ExportSave diagnostic dataCopy message content

Context Data Explorer

Access Context Storage:

  • Open OV20i Node-RED interface (http://<camera-ip>/recipes/<recipe-number>/ioblock)
  • Go to Context Data tab (right sidebar)
  • View Node/Flow/Global context values

Context Debugging:

  • Node Context: Check individual node state
  • Flow Context: Verify shared flow variables
  • Global Context: Review system-wide settings

Network Communication Testing

HTTP Request Validation:

  1. Use external tools (Postman, curl) to test endpoints
  2. Verify response formats match expected data
  3. Test error conditions (timeouts, invalid responses)

PLC Communication Verification:

  1. Use PLC programming software to verify connectivity
  2. Test data register access independently
  3. Validate data format conversions

Emergency Recovery Procedures

Flow Corruption Recovery

Symptoms of Corruption:

  • OV20i Node-RED interface won't load flows
  • Flows appear empty after camera restart
  • Deployment fails repeatedly

Recovery Steps:

  1. Power cycle the OV20i camera:
    • Unplug power for 10 seconds
    • Wait for complete boot (all 4 LEDs stable)
  2. Access recipe's Node-RED interface:
    • Navigate to http://<camera-ip>/recipes/<recipe-number>/ioblock
    • If flows are corrupted, import from backup
  3. Restore from backup:
    • Use OV20i recipe import function
    • Import most recent backup file
    • Verify all connections intact
  4. Validate restoration:
    • Test all critical flows
    • Verify external communications
    • Update any configuration changes

System Resource Issues

Memory/CPU Overload

Immediate Actions:

  1. Disable non-essential Debug nodes in OV20i Node-RED
  2. Remove high-frequency timer triggers
  3. Simplify complex Function nodes
  4. Power cycle the camera to restart all services

Long-term Solutions:

  • Optimize flow design for OV20i hardware
  • Implement rate limiting
  • Reduce message payload sizes
  • Schedule maintenance windows

Troubleshooting Checklists

Pre-Maintenance Checklist

  • Notify production of maintenance window
  • Create current flow backup
  • Document current system state
  • Prepare rollback procedure
  • Test backup restoration process

Post-Maintenance Validation

  • All flows deploy successfully
  • Manual trigger tests pass
  • External communications verified
  • Error indicators cleared
  • Performance within acceptable range
  • Documentation updated

Emergency Response Checklist

  • System impact assessed
  • Production notified
  • Quick-fix attempted
  • Backup restoration if needed
  • Root cause identified
  • Preventative measures implemented

Documentation and Logging

Maintenance Records

Required Documentation:

  • Date/time of maintenance
  • Issues identified and resolved
  • Configuration changes made
  • Performance improvements achieved
  • Future recommendations

tip

Document all changes made during debugging sessions. This helps with future troubleshooting and builds institutional knowledge for your team.